import { S } from '../../s';
import { IPSAppDEDataSet } from '../dataentity/ipsapp-dedata-set';
import { IPSAppDEField } from '../dataentity/ipsapp-defield';
import { IPSAppDataEntity } from '../dataentity/ipsapp-data-entity';
import { IPSAppDEDataSetViewMsg } from './ipsapp-dedata-set-view-msg';
import { PSAppViewMsgImpl } from './psapp-view-msg-impl';

export class PSAppDEDataSetViewMsgImpl
  extends PSAppViewMsgImpl
  implements IPSAppDEDataSetViewMsg
{
  get cacheScope(): 'GLOBAL' {
    return this.M.cacheScope;
  }

  protected cachetag2psappdefield: IPSAppDEField;
  getCacheTag2PSAppDEField(): IPSAppDEField | null {
    if (this.cachetag2psappdefield != null) return this.cachetag2psappdefield;
    const value = this.M.getCacheTag2PSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.cachetag2psappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.cachetag2psappdefield;
  }

  protected cachetagpsappdefield: IPSAppDEField;
  getCacheTagPSAppDEField(): IPSAppDEField | null {
    if (this.cachetagpsappdefield != null) return this.cachetagpsappdefield;
    const value = this.M.getCacheTagPSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.cachetagpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.cachetagpsappdefield;
  }

  get cacheTimeout(): number {
    return this.M.cacheTimeout;
  }

  protected contentpsappdefield: IPSAppDEField;
  getContentPSAppDEField(): IPSAppDEField | null {
    if (this.contentpsappdefield != null) return this.contentpsappdefield;
    const value = this.M.getContentPSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.contentpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.contentpsappdefield;
  }

  protected msgpospsappdefield: IPSAppDEField;
  getMsgPosPSAppDEField(): IPSAppDEField | null {
    if (this.msgpospsappdefield != null) return this.msgpospsappdefield;
    const value = this.M.getMsgPosPSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.msgpospsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.msgpospsappdefield;
  }

  protected msgtypepsappdefield: IPSAppDEField;
  getMsgTypePSAppDEField(): IPSAppDEField | null {
    if (this.msgtypepsappdefield != null) return this.msgtypepsappdefield;
    const value = this.M.getMsgTypePSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.msgtypepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.msgtypepsappdefield;
  }

  protected ordervaluepsappdefield: IPSAppDEField;
  getOrderValuePSAppDEField(): IPSAppDEField | null {
    if (this.ordervaluepsappdefield != null) return this.ordervaluepsappdefield;
    const value = this.M.getOrderValuePSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.ordervaluepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.ordervaluepsappdefield;
  }

  protected psappdedataset: IPSAppDEDataSet;
  getPSAppDEDataSet(): IPSAppDEDataSet | null {
    if (this.psappdedataset != null) return this.psappdedataset;
    const value = this.M.getPSAppDEDataSet;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdedataset = ipsappdataentity.findPSAppDEDataSet(value);
    }
    return this.psappdedataset;
  }

  protected psappdataentity: IPSAppDataEntity;
  getPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.psappdataentity ||
      (this.psappdataentity = this.fillObjectModel(
        S._f,
        this.M.getPSAppDataEntity,
        S._2aa,
      ) as IPSAppDataEntity)
    );
  }

  protected removeflagpsappdefield: IPSAppDEField;
  getRemoveFlagPSAppDEField(): IPSAppDEField | null {
    if (this.removeflagpsappdefield != null) return this.removeflagpsappdefield;
    const value = this.M.getRemoveFlagPSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.removeflagpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.removeflagpsappdefield;
  }

  protected titlelanrestagpsappdefield: IPSAppDEField;
  getTitleLanResTagPSAppDEField(): IPSAppDEField | null {
    if (this.titlelanrestagpsappdefield != null)
      return this.titlelanrestagpsappdefield;
    const value = this.M.getTitleLanResTagPSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.titlelanrestagpsappdefield =
        ipsappdataentity.findPSAppDEField(value);
    }
    return this.titlelanrestagpsappdefield;
  }

  protected titlepsappdefield: IPSAppDEField;
  getTitlePSAppDEField(): IPSAppDEField | null {
    if (this.titlepsappdefield != null) return this.titlepsappdefield;
    const value = this.M.getTitlePSAppDEField;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.titlepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.titlepsappdefield;
  }

  get enableCache(): boolean {
    return this.M.enableCache;
  }
  get cls(): string {
    return 'PSAppDEDataSetViewMsgImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._87) return true;
    return super.instanceof(cls);
  }
}
